<template>
	<view class="box">
		<!-- 背景图片 -->
		<view class="box_image">
			<image style="width: 100%; height: 562rpx; object-fit: cover;" :src="bgImage"></image>

			<!-- 功能导航 -->
			<view class="box_dah">
				<view v-for="(item, index) in functionalItems" :key="index" class="Functional_navigation"
					@click="navigateTo(item.url)">
					<image class="boxind-tup" :src="item.icon"></image>
					<view class="notification" v-if="item.text === '消息通知'">{{ item.notificationCount }}</view>
					<view class="box_text">{{ item.text }}</view>
				</view>
			</view>
		</view>

		<!-- 我的任务 -->
		<view class="woderw">
			<view class="rwu_bt">
				<view style="display: flex; justify-content: space-between;">
					<view class="yangshi"></view>
					<view class="wdwu">我的任务</view>
				</view>
				<view class="quanburw">全部任务 ></view>
			</view>
			<view class="renwu">
				<view v-for="(item, index) in tup1Data" :key="index" class="tup1" @click="goToPage(item.targetUrl)">
					<image style="width: 100%; height: 100%;" :src="item.imagePath"></image>
					<view class="dingwei">
						<view style="display: flex;">
							<image style="width: 112rpx; height: 26rpx;" :src="item.imagedaiban"></image>
							<view class="jijdaoqi" v-if="item.jijdaoqi">即将到期{{ item.jijdaoqi }}</view>
						</view>
						<view class="shuzi">{{ item.number }}</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 统计报表 -->
		<view class="tongjibb">
			<view class="rwu_bt">
				<view style="display: flex; justify-content: space-between;">
					<view class="yangshi"></view>
					<view class="wdwu">统计报表</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 背景图片
				bgImage: '../../static/Home/bg@2x.png',

				// 功能项数据
				functionalItems: [{
						icon: '../../static/Home/ico_xm@2x.png',
						text: '项目管理',
						url: '/pages/projectmanagement/projectmanagement'
					},
					{
						icon: '../../static/Home/ico_khsq@2x.png',
						text: '客户授权',
						url: '/pages/Customer_Authorization/Customer_Authorization'
					},
					{
						icon: '../../static/Home/ico_fare@2x.png',
						text: '费用报销',
						url: '/pages/Expense_Reimbursement/Expense_Reimbursement'
					},
					{
						icon: '../../static/Home/ico_message@2x.png',
						text: '消息通知',
						url: '/pages/message_notification/message_notification',
						notificationCount: 6
					},
					{
						icon: '../../static/Home/ico_xm@2x.png',
						text: '项目列表',
						url: '/pages/project-onw/project-onw'
					},
					{
						icon: '../../static/Home/ico_xm@2x.png',
						text: '客户维护',
						url: '/pages/index/index'
					},
					{
						icon: '../../static/Home/ico_xm@2x.png',
						text: '发布提问',
						url: '/pages/Postaquestion/Postaquestion'
					},
					{
						icon: '../../static/Home/ico_xm@2x.png',
						text: '通知公告',
						url: '/pages/notifications/notifications'
					}
				],

				// 我的任务数据
				tup1Data: [{
						targetUrl: '/pages/My_task/to_dolist',
						imagePath: '../../static/Home/box1@2x.png',
						number: 13,
						imagedaiban: '../../static/Home/daibanshixi@2x.png'
					},
					{
						targetUrl: '/pages/My_task/inprogress',
						imagePath: '../../static/Home/box2@2x.png',
						number: 14,
						imagedaiban: '../../static/Home/jinxzhong@2x.png',
						jijdaoqi: '5'
					},
					{
						targetUrl: '/pages/My_task/Already_overdue',
						imagePath: '../../static/Home/box3@2x.png',
						number: 15,
						imagedaiban: '../../static/Home/yiyuqi@2x.png'
					}
				]
			};
		},
		methods: {
			// 页面跳转方法
			navigateTo(url) {
				uni.navigateTo({
					url
				});
			},

			// 任务详情页跳转
			goToPage(url) {
				uni.navigateTo({
					url
				});
			}
		}
	};
</script>

<style scoped>
	/* 样式部分 */
	.rwu_bt {
		display: flex;
		padding: 0 20rpx;
		justify-content: space-between;
	}

	.wdwu {
		font-weight: bold;
		font-size: 32rpx;
		color: #222222;
		margin-left: 10rpx;
	}

	.quanburw {
		font-weight: 400;
		font-size: 28rpx;
		color: #999999;
	}

	.woderw {
		margin-top: 230rpx;
	}

	.tongjibb {
		margin-top: 40rpx;
	}

	.box_image {
		position: relative;
	}

	.box_dah {
		width: 85%;
		display: flex;
		position: absolute;
		bottom: -160rpx;
		left: 50%;
		transform: translateX(-50%);
		margin: 0 auto;
		flex-wrap: wrap;
		justify-content: space-evenly;
		padding: 30rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 10rpx 20rpx 0rpx rgba(48, 57, 174, 0.08);
		border-radius: 16rpx;
	}

	.Functional_navigation {
		text-align: center;
		position: relative;
		margin: 20rpx;
	}

	.boxind-tup {
		width: 56rpx;
		height: 56rpx;
	}

	.box_text {
		font-weight: 400;
		font-size: 24rpx;
		color: #222222;
	}

	.yangshi {
		width: 10rpx;
		height: 40rpx;
		background: #4170FF;
		border-radius: 9rpx;
	}

	.renwu {
		display: flex;
		justify-content: space-evenly;
		margin-top: 36rpx;
		padding: 0 36rpx;
	}

	.tup1 {
		width: 214rpx;
		height: 144rpx;
		box-sizing: border-box;
		position: relative;
	}

	.shuzi {
		font-weight: bold;
		font-size: 36rpx;
		color: #FFFFFF;
	}

	.jijdaoqi {
		width: 60rpx;
		height: 20rpx;
		background: #4170FF;
		border-radius: 12rpx 0rpx 12rpx 0rpx;
		font-weight: bold;
		font-size: 12rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 20rpx;
		margin-left: 10rpx;
	}

	.dingwei {
		position: absolute;
		top: 30rpx;
		left: 26rpx;
	}

	.notification {
		position: absolute;
		width: 40rpx;
		height: 30rpx;
		background: #D31A1A;
		border-radius: 16rpx;
		font-weight: bold;
		font-size: 22rpx;
		color: #FFFFFF;
		line-height: 30rpx;
		text-align: center;
		top: -10rpx;
		right: 5rpx;
	}
</style>